<div id="statBet_tables" class="cp-box1">
		 <div style="padding: 5px 0px;">
			日期：
		   	<input id="startDate">
		   	至
		   	<input id="endDate">
		   	&nbsp;&nbsp;
			<a class="u-btn u-btn17">查询</a>
		 </div>
		<table class="u-table2 play_tab_10" id="preWeekTable">
			<thead>
				<tr>
					<th width="16%">日期</th>
					<th width="16%">注数</th>
					<th width="16%">下注金额</th>
					<th width="16%">返水</th>
					<th width="16%">盈亏</th>
					<th width="">查看注单</th>
				</tr>
			</thead>
			<tbody>
				<tr>
					<td colspan="6">数据加载中，请耐心等待</td>
				</tr>
			</tbody>
		</table>
		<div id="listPage" class="megas512 zxf_pagediv">
		</div>
		<div style="height: 40px;"></div>
</div>
<style type="text/css">
	#preWeekTable a {
		color: blue;
	}
</style>

<script>
	// 日期
	$("#startDate").datepicker({format: 'yyyy-mm-dd'});
	$("#endDate").datepicker({format: 'yyyy-mm-dd'});

	var t = new Date().getTime();
	var t2 = t - 7 * 24 * 3600 * 1000;
	$("#endDate").datepicker("setValue", new Date(t).Format("yyyy-MM-dd"));
	$("#startDate").datepicker("setValue", new Date(t2).Format("yyyy-MM-dd"));

	Util.queryTemplate($("#preWeekTable tbody"), ".zxf_pagediv", $(".u-btn17"), function(page, size, cb) {
		var s = $("#startDate").val().trim();
		var e = $("#endDate").val().trim();
		startLoading();
		CMD.stat_user_uquery(null, s, e, size, page, function(r) {
			stopLoading();
			cb(r);
		});
    }, function(table, list, sum) {
        if (Util.isEmpty(list)) {
            table.append("<tr><td colspan='6'>暂无数据</tr>");
            return;
        }

        for (var i in list) {
            var d = list[i];
            var tr = $("<tr></tr>");
            tr.append("<td>" + d.date + "</td>");
			tr.append("<td>" + d.betCount + "</td>");
			tr.append("<td>" + d.betSum/100 + "</td>");
			tr.append("<td>" + d.betBack/100 + "</td>");
			tr.append("<td>" + (d.betProfit + d.betBack)/100 + "</td>");
			tr.append('<td><a href="#" value="__v__">注单详情</a></td>'.replace(/__v__/, d.date));
            table.append(tr);
        }

		$("#preWeekTable a").click(function(e) {
			context.center.date = $(e.currentTarget).attr("value");
			switch_page("center/log", $(".content-wrap"));
		});
    });    
</script>